<template>
  <smart-page>

    <template #search>
      <smart-search :query-array="ADDRESS_SEARCH" @on-handler="onSearch"/>
    </template>
    <a-table v-model:selectedKeys="selectedKeys"
             :table-layout-fixed="theme.layoutFixed"
             :row-selection="rowSelection"
             :columns="ADDRESS_COLUMNS"
             :row-key="rowKey"
             :column-resizable="theme.resizable"
             :bordered="theme.bordered"
             :stripe="theme.stripe"
             :sticky-header="theme.sticky"
             :hoverable="theme.hoverAble"
             :pagination="pagination"
             :loading="theme.loading"
             :data="dataSource"
             @page-change="onPageChange"
             @page-size-change="onPageSizeChange">

    </a-table>

  </smart-page>
</template>
<script lang="ts" setup name="member-base-rank">
import {onMounted} from 'vue';

import {ADDRESS_SEARCH} from '../resource/search'
import {ADDRESS_COLUMNS} from "../resource/colums";
import {TablePage} from "@/libs/core";
import {SystemHttp} from "../resource/http";
import {Acl} from "@/libs/acl";


const pageConfig = {title: '会员地址', rowKey: 'id', nameKey: 'name'}
const {getAddressPage, delAddress} = SystemHttp
const tablePage = new TablePage(pageConfig).setFetchXhr(getAddressPage).setDeleteXhr(delAddress).setPermission(Acl.MEMBER_PROFILE_ADDRESS_PAGE_LIST);

const {theme, pagination, rowKey, dataSource, rowSelection, selectedKeys} = tablePage
const {onFetch, onPageChange, onPageSizeChange,   onSearch} = tablePage
onMounted(() => onFetch())


</script>

